*This do file creates tables A-X in the appendix for "Deadly foreign terrorism and the rank-ordered tournament for foreign press attention: implications for counterterrorism."

set more off
mi xtset strtloc year

*******************************************************************************
**                                                                           **
**  Appendix Table A: Descriptive Statistics, 1990-2004                      **
**                                                                           **
*******************************************************************************

tabstat deadly_attacks_lead newrank_attention_ratio fh_pressfree bReuters vshare casualtyratelead ngroups rivnumb polity2 cap usalliance interventions crisis if year>1989 & year<2005, stat(count mean sd min median max)
estimates store Model1

esttab Model1, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table A: Descriptive Statistics, 1990-2004.)

**********************************************************************************************************
**                                                                           							**
**  Appendix Table B: Press attention and the incidence of deadly attacks (Negative binomial regression)**
**                                                                          							**
**********************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead newrank_attention_ratio
estimates store Model1

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree
estimates store Model2

**Multivariate model including the number of terrorist groups in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model7

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio
estimates store Model8
*mcp newrank_attention_ratio, at1(.01 .25 .49 .73 .98) ci

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree
estimates store Model9

*Multivariate model including control for group competition
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups
estimates store Model10

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb
estimates store Model11

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap
estimates store Model12

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model13

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model14
*mcp newrank_attention_ratio, at(fh_pressfree=(0) rivnumb=(0) cap=(.006) usalliance=(0) interventions=(0) polity2=(1)) at1(.01 .25 .49 .73 .98) ci

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 Model10 Model11 Model12 Model13 Model14, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table B: Press attention and the incidence of deadly attacks (Negative binomial regression).)

********************************************************************************************************************************************
**                                                                       																  **
**  Appendix Table C: Table C: Press attention and the incidence of deadly attacks (CEM, Negative binomial regression).                   **
**                																						                                  **
********************************************************************************************************************************************

sum newrank_attention_ratio, detail
recode  newrank_attention_ratio (.005/.24=1) (.2408/0.7=2) (.701/.99=3), gen(treatment)
tab treatment
gen treatment2=treatment*treatment
cem polity2 rivnumb cap bReuters fh_pressfree if treatment!=., treatment(treatment) noimbal

xtnbreg deadly_attacks_lead  treatment if cem_weights!=0
estimates store Model1

xtnbreg deadly_attacks_lead  treatment treatment2 if cem_weights!=0
estimates store Model2

xtnbreg deadly_attacks_lead treatment polity2 rivnumb cap bReuters fh_pressfree if cem_weights!=0
estimates store Model3

xtnbreg deadly_attacks_lead treatment treatment2 polity2 rivnumb cap bReuters fh_pressfree if cem_weights!=0
estimates store Model4
esttab Model1 Model2 Model3 Model4, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) gaps title(Table C: Press attention and the incidence of deadly attacks (CEM, Negative binomial regression).) 

*******************************************************************************************************************
**                                                                        										 **
**  Appendix Table D: History of terrorism, press attention, and the incidence of deadly attacks (Two Stage).    **
**                                                                          									 **
*******************************************************************************************************************

*ssc install cmp, replace
*ssc install ghk2, replace

generate binary_deadly_attacks_lead=0
replace binary_deadly_attacks_lead=1 if deadly_attacks_lead>0
cmp setup

*Stage 1: REG; STAGE 2: PROBIT 
cmp (binary_deadly_attacks_lead = newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree rivnumb cap usalliance interventions crisis polity2) (newrank_attention_ratio = ter_masteravg), ind($cmp_probit $cmp_cont) vce(robust)
estimates store Model1
esttab Model1, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table D: History of terrorism, press attention, and the incidence of deadly attacks (Two Stage).)

*********************************************************************************************************************************
**                                                                        													   **
** Appendix Table E: Press attention, media congestion, and the incidence of deadly attacks (Negative binomial regression).    **
**                                                                        													   **
*********************************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare
estimates store Model1

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree
estimates store Model2

*Multivariate model including the number of group competitions in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb cap
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model7

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps append title (Table E: Press attention, media congestion, and the incidence of deadly attacks (Negative binomial regression).)

***********************************************************************************************************************************
**                                                             														             **
**  Appendix Table F: Press attention and the intensity of deadly attacks (Negative binomial regression, Random effects).        **
**                        								               														     **
***********************************************************************************************************************************

xtnbreg two_dead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model1

xtnbreg five_dead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model2

xtnbreg ten_dead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model3

esttab Model1 Model2 Model3, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table F: Press attention and the intensity of deadly attacks (XTNBREG, Random effects).)

*********************************************************************************************************************************
**                                                         														               **
**  Appendix Table G: Press attention and the intensity of deadly attacks (Negative binomial regression, Fixed effects).       **
**                      																				                       **
*********************************************************************************************************************************

xtnbreg two_dead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2, fe
estimates store Model1

xtnbreg five_dead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2, fe
estimates store Model2

xtnbreg ten_dead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2,fe
estimates store Model3

esttab Model1 Model2 Model3, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table G: Press attention and the intensity of deadly attacks (XTNBREG, Fixed effects).)

*******************************************************************************************************************************
**                                                                         													 **
**  Appendix Table H: Press attention and the incidence of deadly attacks (Negative binomial regression fixed effects).      **
**                                                                       													 **
*******************************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead newrank_attention_ratio, fe
estimates store Model1

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree, fe
estimates store Model2

*Multivariate model including control for group competition
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups, fe
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb, fe
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap, fe
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis, fe
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2, fe
estimates store Model7

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio, fe
estimates store Model8

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree, fe
estimates store Model9

*Multivariate model including control for group competition
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups, fe
estimates store Model10

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb, fe
estimates store Model11

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap, fe
estimates store Model12

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis, fe
estimates store Model13

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2, fe
estimates store Model14

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 Model10 Model11 Model12 Model13 Model14, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table H: Press attention and the incidence of deadly attacks (Negative binomial regression, fixed effects).)

***********************************************************************************************
**                                                                        					 **
**  Appendix Table I: Press attention and the incidence of deadly attacks (Poisson).  	     **
**                                                                          				 **
***********************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtpoisson deadly_attacks_lead newrank_attention_ratio
estimates store Model1

*Multivariate model including control for press freedom
xtpoisson deadly_attacks_lead newrank_attention_ratio fh_pressfree
estimates store Model2

*Multivariate model including control for group competition
xtpoisson deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtpoisson deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb
estimates store Model4

*Multivariate adding in military capability (CINC)
xtpoisson deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtpoisson deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model6

*Multivariate model controlling for regime type
xtpoisson deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model7

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtpoisson deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio
estimates store Model8

*Multivariate model including control for press freedom
xtpoisson deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree
estimates store Model9

*Multivariate model including control for group competition
xtpoisson deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups
estimates store Model10

*Multivariate model including the number of rivalries in a given year
xtpoisson deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb
estimates store Model11

*Multivariate adding in military capability (CINC)
xtpoisson deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap
estimates store Model12

*Multivariate model adding in Savun and Philips variables
xtpoisson deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model13

*Multivariate model controlling for regime type
xtpoisson deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model14

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 Model10 Model11 Model12 Model13 Model14, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table I: Press attention and the incidence of deadly attacks (Poisson).)

**************************************************************************************
**                                                                        			**
**  Appendix Table J: Press attention and the incidence of deadly attacks (ZINB).   **
**                                                                         			**
**************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
zinb deadly_attacks_lead newrank_attention_ratio, inflate (newrank_attention_ratio)
estimates store Model1

*Multivariate model including control for press freedom
zinb deadly_attacks_lead newrank_attention_ratio fh_pressfree, inflate (newrank_attention_ratio fh_pressfree) 
estimates store Model2

*Multivariate model including control for group competition
zinb deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups, inflate (newrank_attention_ratio fh_pressfree ngroups)
estimates store Model3

*Multivariate model including the number of rivalries in a given year
zinb deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb, inflate (newrank_attention_ratio fh_pressfree ngroups rivnumb) 
estimates store Model4

*Multivariate adding in military capability (CINC)
zinb deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap, inflate (newrank_attention_ratio fh_pressfree ngroups rivnumb cap) 
estimates store Model5

*Multivariate model adding in Savun and Philips variables
zinb deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis, inflate (newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis) 
estimates store Model6

*Multivariate model controlling for regime type
zinb deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2, inflate (newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2)
estimates store Model7

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
zinb deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio, inflate (newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio) 
estimates store Model8

*Multivariate model including control for press freedom
zinb deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree, inflate (newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree) 
estimates store Model9

*Multivariate model including control for group competition
zinb deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups, inflate (newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups) 
estimates store Model10

*Multivariate model including the number of rivalries in a given year
zinb deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb, inflate (newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb) 
estimates store Model11

*Multivariate adding in military capability (CINC)
zinb deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap, inflate(newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap)
estimates store Model12

*Multivariate model adding in Savun and Philips variables
zinb deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis, inflate (newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis) 
estimates store Model13

*Multivariate model controlling for regime type
zinb deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2, inflate (newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2)
estimates store Model14

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 Model10 Model11 Model12 Model13 Model14, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table J: Press attention and the incidence of deadly attacks (ZINB).)

***********************************************************************************************************
**                                                                         								 **
**  Appendix Table K: Press attention and the incidence of deadly attacks (Logit, random effects).       **
**                                                                        								 **
***********************************************************************************************************


*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtlogit binary_deadly_attacks_lead newrank_attention_ratio
estimates store Model1

*Multivariate model including control for press freedom
xtlogit binary_deadly_attacks_lead newrank_attention_ratio fh_pressfree
estimates store Model2

*Multivariate model including the number of rivalries in a given year
xtlogit binary_deadly_attacks_lead newrank_attention_ratio rivnumb
estimates store Model3

*Multivariate adding in military capability (CINC)
xtlogit binary_deadly_attacks_lead newrank_attention_ratio rivnumb cap
estimates store Model4

*Multivariate model adding in Savun and Philips variables
xtlogit binary_deadly_attacks_lead newrank_attention_ratio rivnumb cap usalliance interventions crisis
estimates store Model5

*Multivariate model controlling for regime type
xtlogit binary_deadly_attacks_lead newrank_attention_ratio fh_pressfree rivnumb cap usalliance interventions crisis polity2
estimates store Model6

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtlogit binary_deadly_attacks_lead  newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio
estimates store Model7

*Multivariate model including control for press freedom
xtlogit binary_deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree
estimates store Model8

*Multivariate model including the number of rivalries in a given year
xtlogit binary_deadly_attacks_lead  newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio rivnumb
estimates store Model9

*Multivariate adding in military capability (CINC)
xtlogit binary_deadly_attacks_lead  newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio rivnumb cap
estimates store Model10

*Multivariate model adding in Savun and Philips variables
xtlogit binary_deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio rivnumb cap usalliance interventions crisis
estimates store Model11

*Multivariate model controlling for regime type
xtlogit binary_deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree rivnumb cap usalliance interventions crisis polity2
estimates store Model12

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 Model10 Model11 Model12, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table K: Press attention and the incidence of deadly attacks (Logit, random effects).)

*********************************************************************************************************
**                                                                         							   **
**  Appendix Table L: Press attention and the incidence of deadly attacks (Logit, fixed effects).      **
**                                                                         							   **
*********************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtlogit binary_deadly_attacks_lead newrank_attention_ratio, fe
estimates store Model1

*Multivariate model including control for press freedom
xtlogit binary_deadly_attacks_lead newrank_attention_ratio fh_pressfree, fe
estimates store Model2

*Multivariate model including the number of rivalries in a given year
xtlogit binary_deadly_attacks_lead newrank_attention_ratio rivnumb, fe
estimates store Model3

*Multivariate adding in military capability (CINC)
xtlogit binary_deadly_attacks_lead newrank_attention_ratio rivnumb cap, fe
estimates store Model4

*Multivariate model adding in Savun and Philips variables
xtlogit binary_deadly_attacks_lead newrank_attention_ratio rivnumb cap usalliance interventions crisis, fe
estimates store Model5

*Multivariate model controlling for regime type
xtlogit binary_deadly_attacks_lead newrank_attention_ratio fh_pressfree rivnumb cap usalliance interventions crisis polity2, fe
estimates store Model6

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtlogit binary_deadly_attacks_lead  newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio, fe
estimates store Model7

*Multivariate model including control for press freedom
xtlogit binary_deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree, fe
estimates store Model8

*Multivariate model including the number of rivalries in a given year
xtlogit binary_deadly_attacks_lead  newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio rivnumb, fe
estimates store Model9

*Multivariate adding in military capability (CINC)
xtlogit binary_deadly_attacks_lead  newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio rivnumb cap, fe
estimates store Model10

*Multivariate model adding in Savun and Philips variables
xtlogit binary_deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio rivnumb cap usalliance interventions crisis, fe
estimates store Model11

*Multivariate model controlling for regime type
xtlogit binary_deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree rivnumb cap usalliance interventions crisis polity2, fe
estimates store Model12

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 Model10 Model11 Model12, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table L: Press attention and the incidence of deadly attacks (Logit, fixed effects).)


**********************************************************************************************************************************
**                                                                   													        **
**  Appendix Table M: Press attention (GDELT) and the incidence of deadly attacks, 1990-2004 (Negative binomial regression)     **
**  							                                     														    **
**********************************************************************************************************************************

gen gdeltrestrict=0
replace gdeltrestrict=1 if year>1989 & year<2005

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio if gdeltrestrict==1
estimates store Model1

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree if gdeltrestrict==1
estimates store Model2

*Multivariate model including control for group competition
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups if gdeltrestrict==1
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups rivnumb if gdeltrestrict==1
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups rivnumb cap if gdeltrestrict==1
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis if gdeltrestrict==1
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2 if gdeltrestrict==1
estimates store Model7

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic append gaps title (Table M: Press attention GDELT and the incidence of deadly attacks, 1990-2004 (Negative binomial regression).)

**********************************************************************************************************************************
**                                                                     														    **
**  Appendix Table N: Press attention (GDELT) and the incidence of deadly attacks, 1970-2004 (Negative binomial regression)     **
**                                                                       													    **
**********************************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio
estimates store Model1

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree
estimates store Model2

*Multivariate model including control for group competition
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups rivnumb
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups rivnumb cap
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model7

*Multivariate model controlling for those covariates that we have complete data on starting in 1968
xtnbreg deadly_attacks_lead rank_ratio c.rank_ratio#c.rank_ratio cap polity2
estimates store Model8

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic append gaps title (Table N: Press attention (GDELT) and the incidence of deadly attacks, 1970-2004 (Negative binomial regression).)

*************************************************************************************************************************
** Appendix Table O: Press attention (uncorrected) and the incidence of deadly attacks (Negative binomial regression). **                                                        **
** 																													   **
**                                                                         											   **
*************************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead c.rank_attention##c.rank_attention
estimates store Model1
*mcp newrank_attention_ratio, at1(.01 .25 .49 .73 .98) ci

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead c.rank_attention##c.rank_attention fh_pressfree
estimates store Model2

**Multivariate model including the number of terrorist groups in a given year (group competition)
xtnbreg deadly_attacks_lead c.rank_attention##c.rank_attention fh_pressfree ngroups
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead c.rank_attention##c.rank_attention fh_pressfree ngroups rivnumb
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead c.rank_attention##c.rank_attention fh_pressfree ngroups rivnumb cap
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead c.rank_attention##c.rank_attention fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead c.rank_attention##c.rank_attention fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model7
*mcp newrank_attention_ratio, at(fh_pressfree=(0) rivnumb=(0) cap=(.006) usalliance=(0) interventions=(0) polity2=(1)) at1(.01 .25 .49 .73 .98) ci

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table O: Press attention (uncorrected) and the incidence of deadly attacks (Negative binomial regression).)

******************************************************************************************************************************************
**                                                                         																**
**  Appendix Table P: Press attention, domestic controls, and the incidence of deadly foreign terrorism (Negative binomial regression)  **
**                                                                         																**
******************************************************************************************************************************************
*Multivariate model with executive constraints replace
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb cap usalliance interventions crisis exconst vshare
estimates store Model1

*Multivariate model with regime type and civil war
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2 cwar_ucdp
estimates store Model2

*Multivariate model with regime type, civil war, durable
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2 cwar_ucdp durable 
estimates store Model3

*Multivariate model with all domestics - minus cap
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb usalliance interventions crisis polity2 income logpop cwar_ucdp durable 
estimates store Model4

esttab Model1 Model2 Model3 Model4, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps append title (Table P: Press attention, domestic controls, and the incidence of deadly foreign terrorism (Negative binomial regression)) 

*********************************************************************************************************************************
**                                                                        													   **
**  Appendix Table Q: Press attention, domestic variables covariates and the incidence of deadly attacks (Negative binomial).  **
**                                                                          												   **
*********************************************************************************************************************************

xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio polity2 cwar_ucdp durable income logpop
estimates store Model1

esttab Model1, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps append title (Table Q: Press attention, domestic variables covariates and the incidence of deadly attacks (Negative binomial).) 

************************************************************************************************************************************
**                                                                         														  **
**  Appendix Table R: Press attention, history of terrorism, and the incidence of deadly attacks (Negative binomial regression).  **
**                                                                         														  **
************************************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead newrank_attention_ratio ter_masteravg
estimates store Model1

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ter_masteravg
estimates store Model2

*Multivariate model including control for group competition
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups ter_masteravg
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb ter_masteravg
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap ter_masteravg
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis ter_masteravg
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2 ter_masteravg
estimates store Model7

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio ter_masteravg
estimates store Model8

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ter_masteravg
estimates store Model9

*Multivariate model including control for group competition
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups ter_masteravg
estimates store Model10

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb ter_masteravg
estimates store Model11

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap ter_masteravg
estimates store Model12

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis ter_masteravg
estimates store Model13

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2 ter_masteravg
estimates store Model14

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8 Model9 Model10 Model11 Model12 Model13 Model14, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table R: Press attention, history of terrorism, and the incidence of deadly attacks (Negative binomial regression).)


*******************************************************************************************************************************
**     Appendix Table S: The presence of Reuters bureaus and the incidence of deadly attacks (Negative binomial regression). **                                                  **
**     																											             **
**               																			                                 **
*******************************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio bReuters
estimates store Model1
*mcp newrank_attention_ratio, at1(.01 .25 .49 .73 .98) ci

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio bReuters fh_pressfree
estimates store Model2

**Multivariate model including the number of terrorist groups in a given year (group competition)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio bReuters fh_pressfree ngroups
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio bReuters fh_pressfree ngroups rivnumb
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio bReuters fh_pressfree ngroups rivnumb cap
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio bReuters fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio bReuters fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
*estimates store Model7

** This command creates Figure 2.
mcp2 newrank_attention_ratio, at(fh_pressfree=(0) rivnumb=(0) cap=(.006) usalliance=(0) interventions=(0) polity2=(1) ngroups=(3.3)) at1(.01 (.05) .98) margopts(predict(nu0)) ci

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7, b(2) se(2) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table S: The presence of Reuters bureaus and the incidence of deadly attacks (Negative binomial regression).)

******************************************************************************************************************************
**     Appendix Table T: Total wire service agencies and the incidence of deadly attacks (Negative binomial regression).    **                                                 **
**     																													    **
**               																			                                **
******************************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio btotal
estimates store Model1
*mcp newrank_attention_ratio, at1(.01 .25 .49 .73 .98) ci

*Multivariate model including control for press freedom
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio btotal fh_pressfree
estimates store Model2

**Multivariate model including the number of terrorist groups in a given year (group competition)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio btotal fh_pressfree ngroups
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio btotal fh_pressfree ngroups rivnumb
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio btotal fh_pressfree ngroups rivnumb cap
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio btotal fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio btotal fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model7
*mcp newrank_attention_ratio, at(fh_pressfree=(0) rivnumb=(0) cap=(.006) usalliance=(0) interventions=(0) polity2=(1)) at1(.01 .25 .49 .73 .98) ci

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7, b(2) se(2) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table T: Total wire service agencies and the incidence of deadly attacks (Negative binomial regression).)

*****************************************************************************************************************************
**                                                                            											   **
**Appendix Table U: Press attention, media congestion, and the incidence of casualties (Negative binomial regression)      **
**                        																						           **
*****************************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg casualtyratelead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare deadly_attacks_lead
estimates store Model1

*Multivariate model including control for press freedom
xtnbreg casualtyratelead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree deadly_attacks_lead
estimates store Model2

*Multivariate model including control for group competition
xtnbreg casualtyratelead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups deadly_attacks_lead
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg casualtyratelead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb deadly_attacks_lead
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg casualtyratelead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb cap deadly_attacks_lead
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg casualtyratelead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio vshare fh_pressfree ngroups rivnumb cap usalliance interventions crisis deadly_attacks_lead
estimates store Model6

esttab Model1 Model2 Model3 Model4 Model5 Model6, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic append gaps title (Table U: Press attention, media congestion, and the incidence of casualties (Negative binomial regression).)

*********************************************************************************************************************************
**                                                                          												   **
**  Appendix Table V: Press attention (GDELT) and casualties from terrorist attacks, 1970-2004 (Negative binomial regression)  **
**                                                																			   **
*********************************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem, 1968-2006
xtnbreg casualtyratelead rank_ratio c.rank_ratio#c.rank_ratio deadly_attacks_lead
estimates store Model1

*Multivariate model including control for press freedom
xtnbreg casualtyratelead rank_ratio c.rank_ratio#c.rank_ratio deadly_attacks_lead fh_pressfree
estimates store Model2

*Multivariate model including control for group competition
xtnbreg casualtyratelead rank_ratio c.rank_ratio#c.rank_ratio deadly_attacks_lead fh_pressfree ngroups
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg casualtyratelead rank_ratio c.rank_ratio#c.rank_ratio deadly_attacks_lead fh_pressfree ngroups rivnumb
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg casualtyratelead rank_ratio c.rank_ratio#c.rank_ratio deadly_attacks_lead fh_pressfree ngroups rivnumb cap
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg casualtyratelead rank_ratio c.rank_ratio#c.rank_ratio deadly_attacks_lead fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg casualtyratelead rank_ratio c.rank_ratio#c.rank_ratio deadly_attacks_lead fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model7

*Multivariate model controlling for those covariates that we have complete data on starting in 1968
xtnbreg casualtyratelead rank_ratio c.rank_ratio#c.rank_ratio cap polity2
estimates store Model8

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7 Model8, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic append gaps title (Table V: Press attention (GDELT) and casualties from terrorist attacks, 1970-2004 (Negative binomial regression).)

**********************************************************************************************************************
**     Appendix Table W: Press attention and the incidence of all foreign attacks (Negative binomial regression).   **                                                  **
**    																											    **
**                                                                       										    **
**********************************************************************************************************************

*Bivariate negative binomial model between deadly attacks and the ratio of ranked eventcounts to total number of states in the sytem
xtnbreg perp_serieslead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio
estimates store Model1
*mcp newrank_attention_ratio, at1(.01 .25 .49 .73 .98) ci

*Multivariate model including control for press freedom
xtnbreg perp_serieslead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree
estimates store Model2

**Multivariate model including the number of terrorist groups in a given year (group competition)
xtnbreg perp_serieslead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups
estimates store Model3

*Multivariate model including the number of rivalries in a given year
xtnbreg perp_serieslead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb
estimates store Model4

*Multivariate adding in military capability (CINC)
xtnbreg perp_serieslead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap
estimates store Model5

*Multivariate model adding in Savun and Philips variables
xtnbreg perp_serieslead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis
estimates store Model6

*Multivariate model controlling for regime type
xtnbreg perp_serieslead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model7
*mcp newrank_attention_ratio, at(fh_pressfree=(0) rivnumb=(0) cap=(.006) usalliance=(0) interventions=(0) polity2=(1)) at1(.01 .25 .49 .73 .98) ci

esttab Model1 Model2 Model3 Model4 Model5 Model6 Model7, b(2) se(2) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table W: Press attention and the incidence of all foreign attacks (Negative binomial regression).)

********************************************************************************************************************************************
**                                                                 																          **
**     Appendix Table X: Interaction between press freedom attention and the incidence of deadly attacks (Negative binomial regression).  **
**                                                                         																  **
********************************************************************************************************************************************

*Generate interaction terms
generate newrank_attention_ratio_squared=newrank_attention_ratio*newrank_attention_ratio
generate fh_pressfree_attention=newrank_attention_ratio*fh_pressfree
generate fh_pressfree_attentionsquared=newrank_attention_ratio_squared*fh_pressfree


correlate newrank_attention_ratio newrank_attention_ratio_squared fh_pressfree fh_pressfree_attention fh_pressfree_attentionsquared


*Original Model
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model1

*Model with press freedom + rank attention ratio interaction (no press attention quadratic)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#fh_pressfree fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model2

*Model with two interaction terms (press freedom quadratic and press freedom + press attention)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio c.newrank_attention_ratio#fh_pressfree fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model3

*Model with three interaction terms (press freedom quadratic and press freedom + press attention and pressfreedom attention quadratic)
xtnbreg deadly_attacks_lead newrank_attention_ratio c.newrank_attention_ratio#c.newrank_attention_ratio c.newrank_attention_ratio#fh_pressfree c.newrank_attention_ratio#c.newrank_attention_ratio#fh_pressfree fh_pressfree ngroups rivnumb cap usalliance interventions crisis polity2
estimates store Model4
esttab Model1 Model2 Model3 Model4, b(3) se(3) parentheses star(* 0.10 ** 0.05 *** 0.01) aic gaps title (Table X: Interaction between press freedom attention and the incidence of deadly attacks (Negative binomial regression).)
